<!doctype html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  
    
      
    

    
  

  

  
    
      
    

    
  

  
    
      
    

    
  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Monda:300,300italic,400,400italic,700,700italic|Roboto Slab:300,300italic,400,400italic,700,700italic|Lobster Two:300,300italic,400,400italic,700,700italic|PT Mono:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Laravel," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="本文内容来自于JellyBool的视频，地址: Laravel 实战开发知乎：站内信通知

很早就听说过站内信通知，一直以为实现站内通信功能应该会很困难，没有一点思路，直到遇见了Laravist…这次我们将用laravel 5.3实现关注用户消息提醒，为了更好的理解下列内容，建议去看看官方文档（laravel notifications）。
laravel支持多种频道发送通知，下面我将使用数据库">
<meta property="og:type" content="article">
<meta property="og:title" content="Laravel Notifications实现站内信通知">
<meta property="og:url" content="http://yoursite.com/2017/04/20/Laravel-Notifications实现站内信通知/index.html">
<meta property="og:site_name" content="EasyBlog">
<meta property="og:description" content="本文内容来自于JellyBool的视频，地址: Laravel 实战开发知乎：站内信通知

很早就听说过站内信通知，一直以为实现站内通信功能应该会很困难，没有一点思路，直到遇见了Laravist…这次我们将用laravel 5.3实现关注用户消息提醒，为了更好的理解下列内容，建议去看看官方文档（laravel notifications）。
laravel支持多种频道发送通知，下面我将使用数据库">
<meta property="og:updated_time" content="2017-04-20T11:48:54.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Laravel Notifications实现站内信通知">
<meta name="twitter:description" content="本文内容来自于JellyBool的视频，地址: Laravel 实战开发知乎：站内信通知

很早就听说过站内信通知，一直以为实现站内通信功能应该会很困难，没有一点思路，直到遇见了Laravist…这次我们将用laravel 5.3实现关注用户消息提醒，为了更好的理解下列内容，建议去看看官方文档（laravel notifications）。
laravel支持多种频道发送通知，下面我将使用数据库">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2017/04/20/Laravel-Notifications实现站内信通知/"/>





  <title> Laravel Notifications实现站内信通知 | EasyBlog </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?07a6d49ae67fe991e0ce3c2f3955e0f9";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>










  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">EasyBlog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <h1 class="site-subtitle" itemprop="description"></h1>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2017/04/20/Laravel-Notifications实现站内信通知/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Gasbylei">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="http://gasbylei.github.io/uploads/avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="EasyBlog">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">
            
            
              
                Laravel Notifications实现站内信通知
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-04-20T18:47:53+08:00">
                2017-04-20
              </time>
            

            

            
          </span>

          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/2017/04/20/Laravel-Notifications实现站内信通知/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count disqus-comment-count" data-disqus-identifier="2017/04/20/Laravel-Notifications实现站内信通知/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <blockquote>
<p>本文内容来自于JellyBool的视频，地址: <a href="https://www.laravist.com/series/build-a-zhihu-website-with-laravel/episodes/21" target="_blank" rel="external">Laravel 实战开发知乎：站内信通知</a></p>
</blockquote>
<h4 id="很早就听说过站内信通知，一直以为实现站内通信功能应该会很困难，没有一点思路，直到遇见了Laravist…"><a href="#很早就听说过站内信通知，一直以为实现站内通信功能应该会很困难，没有一点思路，直到遇见了Laravist…" class="headerlink" title="很早就听说过站内信通知，一直以为实现站内通信功能应该会很困难，没有一点思路，直到遇见了Laravist…"></a>很早就听说过站内信通知，一直以为实现站内通信功能应该会很困难，没有一点思路，直到遇见了Laravist…</h4><p>这次我们将用<strong>laravel 5.3</strong>实现关注用户消息提醒，为了更好的理解下列内容，建议去看看官方文档（<a href="http://d.laravel-china.org/docs/5.3/notifications" target="_blank" rel="external">laravel notifications</a>）。</p>
<p>laravel支持多种频道发送通知，下面我将使用数据库通知。</p>
<h4 id="创建Notification文件"><a href="#创建Notification文件" class="headerlink" title="创建Notification文件"></a>创建Notification文件</h4><p>因此这次是做关注用户消息提醒，使用下列命令创建</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">php artisan make:notification NewUserFollowNotification</div></pre></td></tr></table></figure>
<h4 id="创建notification迁移表"><a href="#创建notification迁移表" class="headerlink" title="创建notification迁移表"></a>创建notification迁移表</h4><p>数据库通知频道在一张数据表里存储通知信息。这张表包含了比如通知类型、JSON 格式数据等描述通知的信息。</p>
<p>你可以查询这张表的内容在应用界面上展示通知。但是在这之前，你需要先创建一个数据表来保存通知。</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">php artisan notifications:table</div><div class="line"></div><div class="line">php artisan migrate</div></pre></td></tr></table></figure>
<a id="more"></a>
<h4 id="修改NewUserFollowNotification文件"><a href="#修改NewUserFollowNotification文件" class="headerlink" title="修改NewUserFollowNotification文件"></a>修改NewUserFollowNotification文件</h4><p>每个通知类都有个 <code>via</code> 方法，它决定了通知在哪个频道上发送。开箱即用的通知频道有 <code>mail</code>, <code>database</code>, <code>broadcast</code>, <code>nexmo</code>, 和 <code>slack</code>。<br><code>via</code> 方法受到一个<code>$notifiable</code> 实例，它是接收通知的类实例。你可以用 <code>$notifiable</code> 来决定通知用哪个频道来发送：</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line"><span class="comment">/**</span></div><div class="line"> * Get the notification's delivery channels.</div><div class="line"> *</div><div class="line"> * <span class="doctag">@param</span>  mixed  $notifiable</div><div class="line"> * <span class="doctag">@return</span> array</div><div class="line"> */</div><div class="line"><span class="keyword">public</span> <span class="function"><span class="keyword">function</span> <span class="title">via</span><span class="params">($notifiable)</span></span></div><div class="line">&#123;</div><div class="line">    <span class="keyword">return</span> [<span class="string">'database'</span>];</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<p>如果通知支持被存储到数据表中，应该在通知类中定义一个 <code>toDatabase</code> 或 <code>toArray</code> 方法。这个方法接收 <code>$notifiable</code> 实体参数并返回一个普通的 PHP 数组。这个返回的数组将被转成 JSON 格式并存储到通知数据表的 <code>data</code> 列。例如下面的例子：实现<code>toDatabase</code>方法返回关注者的名字。</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">public</span> <span class="function"><span class="keyword">function</span> <span class="title">toDatabase</span><span class="params">($notifiable)</span></span></div><div class="line">&#123;</div><div class="line">    <span class="keyword">return</span> [</div><div class="line">        <span class="string">'name'</span> =&gt; Auth::guard(<span class="string">'api'</span>)-&gt;user()-&gt;name,</div><div class="line">    ];</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<h4 id="发送通知方法"><a href="#发送通知方法" class="headerlink" title="发送通知方法"></a>发送通知方法</h4><p>在需要通知的操作前使用notify()来发送通知。Laravel 会检测 <code>ShouldQueue</code> 接口并自动将通知的发送放入队列中。</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">public</span> <span class="function"><span class="keyword">function</span> <span class="title">follow</span><span class="params">()</span></span></div><div class="line">  &#123;</div><div class="line">      $userToFollow = <span class="keyword">$this</span>-&gt;user-&gt;byId(request(<span class="string">'user'</span>));</div><div class="line"></div><div class="line">      $followed = Auth::guard(<span class="string">'api'</span>)-&gt;user()-&gt;followThisUser($userToFollow-&gt;id);</div><div class="line"></div><div class="line">      <span class="keyword">if</span> (count($followed[<span class="string">'attached'</span>]) &gt; <span class="number">0</span>) &#123;</div><div class="line">          <span class="comment">//notify()发送通知</span></div><div class="line">          $userToFollow-&gt;notify(<span class="keyword">new</span> NewUserFollowNotification());</div><div class="line">          </div><div class="line">          $userToFollow-&gt;increment(<span class="string">'followers_count'</span>);</div><div class="line"></div><div class="line">          <span class="keyword">return</span> response()-&gt;json([<span class="string">'followed'</span> =&gt; <span class="keyword">true</span>]);</div><div class="line">      &#125;</div><div class="line"></div><div class="line">      $userToFollow-&gt;decrement(<span class="string">'followers_count'</span>);</div><div class="line">      <span class="keyword">return</span> response()-&gt;json([<span class="string">'followed'</span> =&gt; <span class="keyword">false</span>]);</div><div class="line">  &#125;</div></pre></td></tr></table></figure>
<h4 id="如何显示通知"><a href="#如何显示通知" class="headerlink" title="如何显示通知"></a>如何显示通知</h4><p>设置路由</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">Route::get(&apos;notifications&apos;,&apos;NotificationsController@index&apos;);</div></pre></td></tr></table></figure>
<p>创建控制器</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">php artisan make:controller NotificationsController</div></pre></td></tr></table></figure>
<p>创建视图index.php</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div></pre></td><td class="code"><pre><div class="line">@extends('layouts.app')</div><div class="line"></div><div class="line">@section('content')</div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"container"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"row"</span>&gt;</span></div><div class="line">            <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"col-md-8 col-md-offset-2"</span>&gt;</span></div><div class="line">                <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"panel panel-default"</span>&gt;</span></div><div class="line">                    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"panel-heading"</span>&gt;</span>消息通知<span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">                    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"panel-body"</span>&gt;</span></div><div class="line">                        @foreach($user-&gt;notifications as $notification)</div><div class="line">                            @include('notifications.'.snake_case(class_basename($notification-&gt;type)))</div><div class="line">                        @endforeach</div><div class="line">                    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">                <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">            <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">        <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">@endsection</div></pre></td></tr></table></figure>
<p>视图中针对不同种类消息通知，显示不同的视图，使用了一个小方法。根据通知类型返回此通知名称，以此来判断是引入何种消息通知视图文件。只需将通知文件名写成和类型名称一样即可。snake_case()是将指定的字符串转换成<code>蛇形命名</code>。<br>下面是new_user_follow_notification.blade.php,返回关注者名称。</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">li</span> <span class="attr">class</span>=<span class="string">"notifications"</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">"profile/&#123;&#123; $notification-&gt;data['name'] &#125;&#125;"</span>&gt;</span>&#123;&#123; $notification-&gt;data['name'] &#125;&#125;<span class="tag">&lt;/<span class="name">a</span>&gt;</span>关注了你</div><div class="line"><span class="tag">&lt;/<span class="name">li</span>&gt;</span></div></pre></td></tr></table></figure>
<p>至此，发现站内信通知功能实现起来并不是很困难。</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Laravel/" rel="tag"># Laravel</a>
          
        </div>
      

      
        
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/04/18/Laravel-前端API-Token认证/" rel="next" title="Laravel 前端API Token认证">
                <i class="fa fa-chevron-left"></i> Laravel 前端API Token认证
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/05/15/PHP类型-上篇/" rel="prev" title="PHP类型(上篇)">
                PHP类型(上篇) <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>

          
          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="disqus_thread">
        <noscript>
          Please enable JavaScript to view the
          <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a>
        </noscript>
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="http://gasbylei.github.io/uploads/avatar.png"
               alt="Gasbylei" />
          <p class="site-author-name" itemprop="name">Gasbylei</p>
           
              <p class="site-description motion-element" itemprop="description"></p>
           
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">17</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">6</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/Gasbylei" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-4"><a class="nav-link" href="#很早就听说过站内信通知，一直以为实现站内通信功能应该会很困难，没有一点思路，直到遇见了Laravist…"><span class="nav-number">1.</span> <span class="nav-text">很早就听说过站内信通知，一直以为实现站内通信功能应该会很困难，没有一点思路，直到遇见了Laravist…</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#创建Notification文件"><span class="nav-number">2.</span> <span class="nav-text">创建Notification文件</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#创建notification迁移表"><span class="nav-number">3.</span> <span class="nav-text">创建notification迁移表</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#修改NewUserFollowNotification文件"><span class="nav-number">4.</span> <span class="nav-text">修改NewUserFollowNotification文件</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#发送通知方法"><span class="nav-number">5.</span> <span class="nav-text">发送通知方法</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#如何显示通知"><span class="nav-number">6.</span> <span class="nav-text">如何显示通知</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2015 - 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Gasbylei</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Pisces
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    
    
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>

  
  <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.0"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  



  

    <script type="text/javascript">
      var disqus_shortname = 'gatsbylei';
      var disqus_identifier = '2017/04/20/Laravel-Notifications实现站内信通知/';

      var disqus_title = "Laravel Notifications实现站内信通知";


      function run_disqus_script(disqus_script) {
        var dsq = document.createElement('script');
        dsq.type = 'text/javascript';
        dsq.async = true;
        dsq.src = '//' + disqus_shortname + '.disqus.com/' + disqus_script;
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
      }

      run_disqus_script('count.js');

      
        var disqus_config = function () {
            this.page.url = disqus_url;
            this.page.identifier = disqus_identifier;
            this.page.title = disqus_title;
        };
        run_disqus_script('embed.js');
      

    </script>
  










  
  

  

  

  

  


  

</body>
</html>
